{% extends "pretixcontrol/admin/base.html" %}
{% load i18n %}

{% block video_admin_content %}
<h1 class="page-header">{% trans "System log" %}</h1>
<div class="video-admin-table-wrapper">
<table class="table table-striped table-hover video-admin-table">
    <thead>
    <tr>
        <th>{% trans "Timestamp" %}</th>
        <th>{% trans "Module" %}</th>
        <th>{% trans "Event" %}</th>
        <th>{% trans "Message" %}</th>
        <th class="text-right">{% trans "Actions" %}</th>
    </tr>
    </thead>
    <tbody>
    {% for s in systemlogs %}
    <tr>
        <td>{{ s.timestamp|date:"SHORT_DATETIME_FORMAT" }}</td>
        <td>{{ s.module }}</td>
        <td>{{ s.event }}</td>
        <td>{{ s.message }}</td>
        <td class="text-right video-admin-actions">
            <a href="{% url 'eventyay_admin:video_admin:systemlog.detail' pk=s.pk %}" class="btn btn-default btn-xs">
                <span class="fa fa-search"></span> {% trans "Details" %}
            </a>
        </td>
    </tr>
    {% empty %}
        <tr><td colspan="5" class="text-muted">{% trans "No log entries found." %}</td></tr>
    {% endfor %}
    </tbody>
</table>
</div>
<div class="pagination">
    <span class="step-links">
        {% if page_obj.has_previous %}
            <a href="?page=1">&laquo; {% trans "first" %}</a>
            <a href="?page={{ page_obj.previous_page_number }}">{% trans "previous" %}</a>
        {% endif %}

        <span class="current">
            {% blocktrans with current=page_obj.number total=page_obj.paginator.num_pages %}Page {{ current }} of {{ total }}.{% endblocktrans %}
        </span>

        {% if page_obj.has_next %}
            <a href="?page={{ page_obj.next_page_number }}">{% trans "next" %}</a>
            <a href="?page={{ page_obj.paginator.num_pages }}">{% trans "last" %} &raquo;</a>
        {% endif %}
    </span>
</div>
{% endblock %}
